package com.insigma.business.qrcode.soldier._bff.impl;

import com.insigma.business.qrcode.common._consumer.CommonQaInfoConsumer;
import com.insigma.business.qrcode.common.util.RpcContextUtil;
import com.insigma.business.qrcode.common.vo.BaseResponse;
import com.insigma.business.qrcode.common.vo.SessionSoldier;
import com.insigma.business.qrcode.intell.dto.CareSoldierDemandInsertRequest;
import com.insigma.business.qrcode.intell._consumer.CareSoldierDemandConsumer;
import com.insigma.business.qrcode.soldier.request.CommonQaInfoUpdateRequest;
import com.insigma.business.qrcode.soldier._bff.CareSoldierDemandBffProvider;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class CareSoldierDemandBffProviderImpl implements CareSoldierDemandBffProvider {

    @Resource
    CareSoldierDemandConsumer careSoldierDemandConsumer;

    @Resource
    CommonQaInfoConsumer commonQaInfoConsumer;

    @Override
    public BaseResponse<String> saveCareSoldierDemandBySoldier(CareSoldierDemandInsertRequest request) {
        SessionSoldier sessionSoldier = RpcContextUtil.getSessionSoldier();
        request.setSoldierId(sessionSoldier.getUserId());
        return careSoldierDemandConsumer.saveCareSoldierDemandToHz(request);    }

    @Override
    public BaseResponse<String> evaluateQa(CommonQaInfoUpdateRequest request) {
        return commonQaInfoConsumer.evaluateQa(request);
    }
}
